AS=/usr/local/mips-cross/bin/mipsel-elf-as
CC=/usr/local/mips-cross/bin/mipsel-elf-gcc
LD=/usr/local/mips-cross/bin/mipsel-elf-ld
OBJCOPY=/usr/local/mips-cross/bin/mipsel-elf-objcopy
OBJDUMP=/usr/local/mips-cross/bin/mipsel-elf-objdump

all:
	$(AS) -mips1 printstr.S -o printstr.o -EL 
	$(LD) -mips1 -T ../../lib/default.ld printstr.o -o printstr.elf -EL
	$(OBJCOPY) -j .startup.bootvec -j .startup -O binary printstr.elf printstr.bin
	hexdump -e "1/4 \"%08x\n\"" printstr.bin -v > printstr.hex
	cat ../../lib/nops.hex >> printstr.hex
	
dump:
	$(OBJDUMP) -j .startup.bootvec -j .startup -D printstr.elf

symbols:
	$(OBJDUMP) -t printstr.elf

sections:
	$(OBJDUMP) -h printstr.elf

clean:
	rm -f printstr.bin printstr.elf printstr.hex printstr.o
